package com.coo1.onlineorder.server.data;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NullValue;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Unique;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MSTUSER implements java.io.Serializable{
	   @PrimaryKey
	    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	    private String UID;
	    
	    @Unique
	    @Persistent(nullValue = NullValue.EXCEPTION)
	    private String USERNAME;

	    @Persistent
	    private String REALNAME;
	    
	    @Persistent
	    private String PASSWORD;
	    
	    @Persistent
	    private Date SIGNUPDATE;

	    @Persistent
	    private Date LOGINDATE;
	    
	    @Persistent
	    private Boolean SEX;
	    
	    @Persistent
	    private String AGE;
	    
	    @Persistent
	    private String ADDRESS;
	    
	    @Persistent
	    private String MAIL;
	    
	    @Persistent
	    private String LASTORDERID;
	       
	    @Persistent
	    private Date BIRTHDAY;
	    
	    @Persistent
	    private String PHONENUMBER;

	    public MSTUSER(String username, String realname, String password,
	    		Date singupDate,Date loginDate,Boolean sex, String age,
	    		String address,String mail,String phoneNumber, 
	    		String lastorderId,Date birthDay) {
	    	this.UID = "U" + (new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
	        this.USERNAME = username;
	        this.REALNAME = realname;
	        this.PASSWORD = password;
	        this.SIGNUPDATE = singupDate;
	        this.LOGINDATE = loginDate;
	        this.SEX = sex;
	        this.AGE = age;
	        this.ADDRESS = address;
	        this.MAIL = mail;
	        this.LASTORDERID = lastorderId;
	        this.BIRTHDAY = birthDay;
	        this.PHONENUMBER = phoneNumber;
	    }

	    // Accessors for the fields.  JDO doesn't use these, but your application does.

	    public String getId() {
	        return UID;
	    }

	    public String getUsername() {
	        return USERNAME;
	    } 
	    
	    public void SetUsername(String username) {
	    	this.USERNAME = username;
	    } 
	    
	    public String getRealname() {
	        return REALNAME;
	    } 
	    
	    public void setRealname(String realname) {
	    	this.REALNAME = realname;
	    } 
	    
	    public String getPassword() {
	        return PASSWORD;
	    } 
	    
	    public void setPassword(String password) {
	    	this.PASSWORD = password;
	    } 
	    
	    public Date getSingupDate() {
	        return SIGNUPDATE;
	    } 
	    
	    public void setSingupDate(Date singupDate) {
	    	this.SIGNUPDATE = singupDate;
	    } 
	    
	    public Date getLoginDate() {
	        return SIGNUPDATE;
	    } 
	    
	    public void setLoginDate(Date loginDate) {
	    	this.LOGINDATE = loginDate;
	    } 

	    public Boolean getSex() {
	        return SEX;
	    } 
	    
	    public void setSex(Boolean sex) {
	    	this.SEX = sex;
	    } 

	    public String getAge() {
	        return AGE;
	    } 
	    
	    public void setSex(String age) {
	    	this.AGE = age;
	    } 

	    public String getAddress() {
	        return ADDRESS;
	    } 
	    
	    public void setAddress(String address) {
	    	this.ADDRESS = address;
	    } 
	    
	    public String getMail() {
	        return MAIL;
	    } 
	    
	    public void setMail(String mail) {
	    	this.MAIL = mail;
	    } 
	    
	    public String getPhone() {
	        return PHONENUMBER;
	    } 
	    
	    public void setPhone(String Phone) {
	    	this.PHONENUMBER = Phone;
	    } 
	    
	    public String getLastorderId() {
	        return LASTORDERID;
	    } 
	    
	    public void setLastorderId(String lastorderId) {
	    	this.LASTORDERID = lastorderId;
	    } 
	    
	    public Date getBirthDay() {
	        return BIRTHDAY;
	    } 
	    
	    public void setBirthDay(Date birthDay) {
	    	this.BIRTHDAY = birthDay;
	    }
	    
}